<template>
  <div class="company-list-1">
    <div class="header">
      <img class="header-img" src="@/assets/line.svg" />
      <img class="header-img" src="@/assets/line.svg" />
      <img class="header-img" src="@/assets/line.svg" />
      <div class="header-title">服务部生物资产总览</div>
    </div>
    <div class="content">
      <div class="card" v-for="item in props.info">
        <div class="card-title">{{ item.orgName }}</div>
        <div class="card-list">
          <div class="card-list-left">
            <div class="card-list-left-top">
              <div class="label">存栏</div>
              <div class="value">{{ item.stockNum }}</div>
            </div>
            <div class="card-list-left-bottom">
              <svgIcon name="data" width="220px" height="160px"></svgIcon>
            </div>
          </div>
          <div class="card-list-mid"></div>
          <div class="card-list-right">
            <div class="card-list-right-item">
              <div class="label">上市</div>
              <div class="value">{{ item.listedNum }}</div>
            </div>
            <div class="card-list-right-item">
              <div class="label">进苗</div>
              <div class="value">{{ item.collarSeedlingNum }}</div>
            </div>
            <div class="card-list-right-item">
              <div class="label">死淘</div>
              <div class="value">{{ item.deadNum }}</div>
            </div>
            <div class="card-list-right-item">
              <div class="label">尾猪</div>
              <div class="value">{{ item.tailPigNum }}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
import svgIcon from '@/components/SvgIcon.vue'

const props = defineProps({
  info: {
    type: Object,
    default: () => ({
      alarmsNum: 0,
      assignedNum: 0,
      idleNum: 0,
      ondutyPersonnelNum: 0,
      onpatrolNum: 0,
      unassignedNum: 0
    })
  }
})

const data = ref()
</script>

<style scoped lang="scss">
.company-list-1 {
  font-size: 16px;
  border: #354e85 solid 1px;
  width: 100%;
  height: 380px;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #354e85;
  background-color: rgba($color: #fff, $alpha: 0.1);

  .header {
    background: url('@/assets/u25.svg') no-repeat;
    width: 700px;
    height: 50px;
    display: flex;
    align-items: center;
    padding-left: 20px;

    .header-img {
      height: 15px;
      width: 13px;
      margin-left: -4px;
    }

    .header-title {
      color: #51f4f3;
      padding-left: 10px;
    }
  }

  .content {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    padding: 20px 30px;
    overflow-y: auto;

    .card {
      width: 30%;
      border: 1px solid rgba(35, 145, 255, 0.6);
      padding: 10px 20px;
      display: flex;
      flex-direction: column;
      padding: 20px 20px 0;
      margin-bottom: 20px;
      margin-right: 80px;

      &-title {
        font-size: 24px;
        font-weight: bold;
      }

      &-list {
        flex: 1;
        display: flex;
        padding: 20px 10px 0;

        &-left {
          display: flex;
          flex-direction: column;

          &-top {
            display: flex;
            justify-content: space-between;
            align-items: end;

            .value {
              font-size: 30px;
            }
          }
        }

        &-mid {
          display: flex;
          width: 1px;
          height: 180px;
          background-color: rgba(35, 145, 255, 0.6);
          margin: 0 30px;
        }

        &-right {
          display: flex;
          flex-wrap: wrap;

          &-item {
            width: 50%;
            height: 60px;
            padding: 5px;
            display: flex;
            flex-direction: column;
            justify-content: space-around;

            .value {
              font-size: 24px;
            }
          }
        }
      }
    }

    .card:nth-child(3n) {
      margin-right: 0;
    }
  }
}
</style>
